class StyleController < ApplicationController

    def style_list
        @styles = Style.find_all 
    end
        
    def style_select
        @styles = Style.find_all 
        render :layout => 'site'
    end   

    def style_update
        puts params[:site][:style_id]
        puts @site.style.inspect
        newstyle = Style.find(params[:site][:style_id])
        puts newstyle.inspect
        @site.style = newstyle
        
        puts "another: " + @site.style.id.to_s
        @site.save
        puts "after save: " + @site.style.id.to_s
        redirect_to :site_directory => @site, :action => 'style_select' 
    end
   
end
